Attribute VB_Name = "RunCommand"
Option Explicit

'
' execute ATE: no return but wait and has console
'
Sub RunCommand()

    'Dim exePath As String: exePath = """F:\Program Files\Python36\python.exe"""
    Dim exePath As String: exePath = """F:\venv\ATE-tyzyugiq\Scripts\python.exe"""
    
    Dim excelPath As String: excelPath = ActiveWorkbook.FullName
    
    'Dim scriptPath As String: scriptPath = Chr(34) & ActiveWorkbook.Path & "\" & "main.py" & Chr(34)
    Dim scriptPath As String: scriptPath = ActiveWorkbook.path & "\" & "write_value2OSC_Config.py"
    
    Dim command As String
    'run py
    command = exePath & " " & scriptPath & " " & Chr(34) & excelPath & Chr(34)

    ' run exe
    'command = ActiveWorkbook.path & "\" & "write_value2OSC_Config.exe" & " " & Chr(34) & excelPath & Chr(34)
    
    Dim wsh As Object
    Dim waitOnReturn As Boolean: waitOnReturn = True
    Dim windowStyle As Integer: windowStyle = 1
    
    Set wsh = VBA.CreateObject("WScript.Shell")
    wsh.Run command, windowStyle, waitOnReturn

End Sub
